#include "odbc/basic_connection.hpp"
#include "odbc/auto_commit_transaction_policy.hpp"
#include "mysql_conn_fixture_base.hpp"
#include "odbc_test_defs.hpp"
#include <boost/test/auto_unit_test.hpp>

namespace
{

using namespace odbc;

BOOST_AUTO_TEST_CASE( test_establishing_connection)
{
	mysql_conn_fixture_base f;
	ODBCTEST_CHECK_NOTHROW( basic_connection< auto_commit_transaction_policy< false> > conn( f.connection_string_, 10));
	BOOST_CHECK_THROW( basic_connection< auto_commit_transaction_policy< false> >( "Invalid connection string", 10), odbc_error);
	ODBCTEST_CHECK_NOTHROW( basic_connection< auto_commit_transaction_policy< true> > conn( f.connection_string_, 10));
	BOOST_CHECK_THROW( basic_connection< auto_commit_transaction_policy< true> >( "Invalid connection string", 10), odbc_error);
}

} // namespace
